Skip to content

Singular function names, and one name each for the engines' limits - #98

Merged
HalRiveria-Bot merged 9 commits into
mainfrom
change/singular-names
Dec 1, 2026
Merged

HalRiveria-Bot merged 9 commits into
mainfrom
change/singular-names

Conversation

@HalRiveria-Bot

Copy link
Copy Markdown
Collaborator

Renames for the next major version, while few scripts depend on the old names. PowerShell nouns are singular, and the engines had two names for the same two settings.

Breaking

  • Invoke-PkRunspaceJobs is Invoke-PkRunspaceBatch, to match Invoke-PkProcessBatch.
  • -MaxConcurrent and -AbortTimeoutSeconds are the only names, on every engine. -MaxParallel and -DrainTimeoutSeconds were Invoke-PkRunspaceJobs' own names, and aliases on the other two engines; they're gone, and so are the aliases the other way round.

Internal only

  • 13 private functions lose their plural names: Receive-PkWorkerMessage, Resolve-PkArgumentList, Split-PkTaskkillArgumentList, Stop-PkJobProcess, Get-PkJobOutputLimit (was Get-PkJobMaxOutputChars), Wait-PkRunningJob, Add-PkDispatchGroupJob, Get-PkWorkerSafeFunctionName, Add-PkJobError, Receive-PkCompletedHandle, Get-PkPredefinedVariable, Get-PkCommandVariable, Get-PkUndeclaredVariable.

The README, the help and the scripts under Testing/ use the new names. The README's "Not planned" entry on renames now covers only aliases for result fields.

Tests

  • Section AF: every engine takes -MaxConcurrent and -AbortTimeoutSeconds with no aliases, -MaxParallel is an error, and Invoke-PkRunspaceJobs is gone. The test that an unknown argument to Initialize-ParallelKit is refused used -MaxParallel; it uses -AbortTimeoutSeconds now.
  • PSScriptAnalyzer's PSUseSingularNouns reports nothing (14 before).
  • Full harness: 714 passed on Windows PowerShell 5.1 and 714 passed on PowerShell 7.6.2, no skips. Testing/readme-examples/run.ps1 passes on both.

🤖 Generated with Claude Code

HalRiveria and others added 9 commits December 1, 2026 16:12
Two of the batch's own closures called Complete-PkProcess and Write-PkMessage
by name. A .GetNewClosure() block only sees global functions, so a batch failed
with "'Complete-PkProcess' is not recognized" when the kit was loaded for one
module only. They're captured up front now, like the private helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A worker given the function (-SharedFunctionNames takes it) could set a handler
made in its own runspace, which the main thread then ran for every message.
Running another runspace's scriptblock can hang or crash PowerShell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It only looked for an abort after its first 200 ms wait, so a program that
finished sooner ran to the end and returned normally, and a slower one ran for
about 200 ms before it was killed. It now throws before starting the program,
unless -IgnoreAbort is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… GetNewClosure

DelegateCast missed a scriptblock passed to .NET as ({ 1 }), { 1 }.GetNewClosure(),
[scriptblock]{ 1 } and the like, in the call or through a variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Invoke-PkRunspaceJobs is Invoke-PkRunspaceBatch, and 13 private functions lose
their plural names. -MaxConcurrent and -AbortTimeoutSeconds are the only names
on every engine: -MaxParallel and -DrainTimeoutSeconds are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria-Bot
HalRiveria-Bot merged commit ea30da3 into main Dec 1, 2026
4 checks passed
@HalRiveria-Bot
HalRiveria-Bot deleted the change/singular-names branch December 1, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants